//
//  MessageManager.h
//  HotWord
//
//  Created by Rainbow on 7/26/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Message.h"
#import <AudioToolbox/AudioToolbox.h>

@interface MessageManager : NSObject
{
    NSTimer *_messageUpdateTimer;
    BOOL    _isFirstGetMessage;
}

@property (nonatomic, retain) NSMutableDictionary *messages;
@property (nonatomic, retain) NSMutableArray *messageUserIds;
@property (nonatomic, assign) NSString *lastGetMessageTime;
@property (nonatomic, assign) NSInteger newMessageCount;

+ (MessageManager *)sharedManager;

- (void)sendReceiveMessage;
- (void)addMessages:(NSMutableArray *)newMessages;
- (void)removeMessageByUserId:(NSString *)userId;

- (NSMutableArray *)getMessagesByUserId:(NSString *)userId;
- (NSMutableArray *)getLastestMessages;
- (void)clearMessages;


@end
